package com.lv.fast.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.lv.fast.DTO.SysLogDTO;
import com.lv.fast.DTO.SysLogPageQuery;
import com.lv.fast.model.RestResult;
import com.lv.fast.service.SysLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author jie.lv
 */
@RestController
@AllArgsConstructor
@RequestMapping("/sys/log")
@Api(tags = "后台管理---日志模块")
@ApiSupport(author = "lv")
public class SysLogController {

    private final SysLogService sysLogService;

    @GetMapping("/list")
    @ApiOperation(value = "获取日志列表")
    @ApiOperationSupport(order = 1)
    @RequiresPermissions("sys:log:list")
    public RestResult list(@Validated SysLogPageQuery pageQuery){
        IPage<SysLogDTO> page = sysLogService.list(pageQuery);
        return RestResult.success(page);
    }
}
